﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Framework;

namespace Enterprise.Admin.Handle.Technical
{
    public partial class GetDetailJson : AdminBasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            var id = Fq("id").SafeToInt();
            var technicalService = new TechnicalService();
            var row = technicalService.GetById(id);
            object result = new
            {
                CoArticleId = row["CoTechnicalId"].SafeToString(),
                CoTitle = row["CoTitle"].SafeToString(),
                CoContent = row["CoContent"].SafeToString(),
                CoIsRecommend = row["CoIsRecommend"].SafeToBool(),
                CoDate = row["CoDate"].SafeToDateTime().ToString("yyyy-MM-dd HH:mm:ss"),
                CoSummary = row["CoSummary"].SafeToString(),
                CoIsPopular = row["CoIsRecommend"].SafeToBool(),
                CoIsTop = row["CoIsTop"].SafeToBool(),
                CoViews = row["CoViews"].SafeToInt(),
                CoSort = row["CoSort"].SafeToInt(),
                CoLanguage = row["CoLanguage"].SafeToString(),
                CoKeyword = row["CoKeyword"].SafeToString(),
                CoDescription = row["CoDescription"].SafeToString()
            };

            Json(result);
        }
    }
}